]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Merge AllAppDisplay and ViewByCategories
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 30 Jan 2013 22:58:42 +0000 (23:58 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 19 Feb 2013 23:08:11 +0000 (00:08 +0100)
With categories removed, the separation between AllAppDisplay and
ViewByCategories no longer makes sense. Also use this opportunity
to rename the outdated AllAppDisplay to AppDisplay; it will
eventually be used to manage different views.

https://bugzilla.gnome.org/show_bug.cgi?id=694192

data/theme/gnome-shell.css
js/ui/appDisplay.js
js/ui/viewSelector.js

index cb4f23a769070b7f48f854530da7a5b79db4ddcf..41f9965dacc6767a9ffe63c6efb3250b629072fa 100644 (file)
@@ -847,12 +847,12 @@ StScrollBar StButton#vhandle:active {
     icon-size: 96px;
 }
 
-.all-app {
+.app-display {
     padding: 0px 16px 32px 32px;
     spacing: 20px;
 }
 
-.all-app:rtl {
+.app-display:rtl {
     padding-left: 16px;
     padding-right: 32px;
 }
index e5388a4bea767bf78771bcc13fc5c74d20296da9..587e2b5f9c4ea0d91c8b14b271e797cb989a45d9 100644 (file)
@@ -108,22 +108,30 @@ const AlphabeticalView = new Lang.Class({
     }
 });
 
-const ViewByCategories = new Lang.Class({
-    Name: 'ViewByCategories',
+const AppDisplay = new Lang.Class({
+    Name: 'AppDisplay',
 
     _init: function() {
         this._appSystem = Shell.AppSystem.get_default();
-        this.actor = new St.BoxLayout({ style_class: 'all-app' });
-        this.actor._delegate = this;
+        this._appSystem.connect('installed-changed', Lang.bind(this, function() {
+            Main.queueDeferredWork(this._workId);
+        }));
+
+        let box = new St.BoxLayout();
+        this.actor = new St.Bin({ child: box,
+                                  style_class: 'app-display',
+                                  x_fill: true, y_fill: true });
 
         this._view = new AlphabeticalView();
-        this.actor.add(this._view.actor, { expand: true, x_fill: true, y_fill: true });
+        box.add(this._view.actor);
 
         // We need a dummy actor to catch the keyboard focus if the
         // user Ctrl-Alt-Tabs here before the deferred work creates
         // our real contents
         this._focusDummy = new St.Bin({ can_focus: true });
-        this.actor.add(this._focusDummy);
+        box.add(this._focusDummy);
+
+        this._workId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._redisplay));
     },
 
     // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too
@@ -148,7 +156,7 @@ const ViewByCategories = new Lang.Class({
         this._view.removeAll();
     },
 
-    refresh: function() {
+    _redisplay: function() {
         this._removeAll();
 
         var tree = this._appSystem.get_tree();
@@ -176,29 +184,6 @@ const ViewByCategories = new Lang.Class({
     }
 });
 
-/* This class represents a display containing a collection of application items.
- * The applications are sorted based on their name.
- */
-const AllAppDisplay = new Lang.Class({
-    Name: 'AllAppDisplay',
-
-    _init: function() {
-        this._appSystem = Shell.AppSystem.get_default();
-        this._appSystem.connect('installed-changed', Lang.bind(this, function() {
-            Main.queueDeferredWork(this._workId);
-        }));
-
-        this._appView = new ViewByCategories();
-        this.actor = new St.Bin({ child: this._appView.actor, x_fill: true, y_fill: true });
-
-        this._workId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._redisplay));
-    },
-
-    _redisplay: function() {
-        this._appView.refresh();
-    }
-});
-
 const AppSearchProvider = new Lang.Class({
     Name: 'AppSearchProvider',
 
index 85f4a6c3ea66687e38f1f01751c0430d305239f1..4e1f1df61a4f9fd14c179816c3864c81e3557653 100644 (file)
@@ -96,7 +96,7 @@ const ViewSelector = new Lang.Class({
         this._workspacesPage = this._addPage(this._workspacesDisplay.actor,
                                              _("Windows"), 'emblem-documents-symbolic');
 
-        this._appDisplay = new AppDisplay.AllAppDisplay();
+        this._appDisplay = new AppDisplay.AppDisplay();
         this._appsPage = this._addPage(this._appDisplay.actor,
                                        _("Applications"), 'view-grid-symbolic');